<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>焦点事件</title>
	</head>
	<body>
		<input type="text" 
		onfocus="console.log('输入框获取了焦点')"
		onblur="console.log('输入框失去焦点')"/>
	</body>
	<script>
		// 页面一加载，直接让输入框获取了焦点，用户即可输入
		document.getElementsByTagName('input')[0].focus()
	</script>
</html>